home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / c / RConfig.lha / RConfig_v1.1 / docs / resstart.doc < prev    next >
Encoding:
Text File  |  1992-09-13  |  1.8 KB  |  55 lines

  1. TYPE
  2.     _main(R),_exit(R) - Resident Startup and Termination
  3.  
  4. NAME
  5.     "resstart" - residentable programs
  6.  
  7. SYNOPSIS
  8.     none
  9.  
  10. DESCRIPTION
  11.     RESSTART allows your code to be made resident (by the AmigaDOS command),
  12.     by making your program's use of global variables pure and re-entrant.
  13.  
  14.     Usually, a program's global data is located in a DATA segment, which
  15.     is allocated at load time.  Register a4 is then offset 32K from the
  16.     start of this data segment.
  17.  
  18.     RESSTART instead allocates a data segment at run-time, and positions a4
  19.     relative to the start of the new segment.  It follows, that the exit
  20.     code frees the data segment when the program terminates.
  21.  
  22.     Requirements
  23.     ~~~~~~~~~~~~
  24.         o   Small data model...global data limited to 64K in size.
  25.         o   Don't munge register a4, because you can't use geta4().
  26.         o   Don't bypass the exit code.
  27.  
  28.     Recommendations
  29.     ~~~~~~~~~~~~~~~
  30.         o   Don't use the -r4 option when compiling.
  31.  
  32.     Technical Details
  33.     ~~~~~~~~~~~~~~~~~
  34.     RESSTART is limited to small data model, because in this model, accesses
  35.     to global data is address relative to a4.  In the small data model, global
  36.     data is restricted to 64K in size.  a4 is offset 32K from the start of
  37.     global data because the displacement is signed.
  38.  
  39.     Limitations
  40.     ~~~~~~~~~~~
  41.     In general, a co-process calling geta4() (to get the main program's module
  42.     base to it's global data) won't work.
  43.  
  44.     In addition, RESSTART should not be used with the following functions:
  45.  
  46.         o   misc: amisig (signals...trap handler)
  47.         o   sysio: fexec (load & start another program)
  48.         o   sysio: int_start,int_end (for installing an interrupt handler)
  49.  
  50.     DATA & BSS sections must be in same segment.  I'm not sure in what cases
  51.     this isn't true, but you never know...
  52.  
  53. SEE ALSO
  54.     "detach.readme", "detach.man"
  55.